package com.eduhzy.ttw.work.mvp.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author xubo
 * @date 2018/11/30 12:38
 */
public class WorkDetailData implements Parcelable {


    /**
     * audioList : []
     * content : 捕蛇者说 柳宗元
     * createTime : 1543544406000
     * creator : 340328
     * endTime : 1543559459000
     * homeworkClassList : [{"checkedNum":0,"classId":127,"className":"理学班","id":17,"readNum":0,"submitNum":0,"totalNum":1,"workId":12},{"checkedNum":0,"classId":126,"className":"心学班","id":18,"readNum":0,"submitNum":0,"totalNum":7,"workId":12}]
     * id : 12
     * imageList : []
     * online : 0
     * pushTime : 1543544405000
     * title : 2018-11-30 预习古文 捕蛇者说
     * videoList : []
     */

    private String content;
    private long createTime;
    private int creator;
    private String creatorName;
    private long endTime;
    private int id;
    private int online;
    private long pushTime;
    private String title;
    private List<FileListBean> audioList;
    private List<HomeworkClassListBean> homeworkClassList;
    private List<FileListBean> imageList;
    private List<FileListBean> videoList;

    public String getCreatorName() {
        return creatorName;
    }

    public void setCreatorName(String creatorName) {
        this.creatorName = creatorName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public int getCreator() {
        return creator;
    }

    public void setCreator(int creator) {
        this.creator = creator;
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getOnline() {
        return online;
    }

    public void setOnline(int online) {
        this.online = online;
    }

    public long getPushTime() {
        return pushTime;
    }

    public void setPushTime(long pushTime) {
        this.pushTime = pushTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<FileListBean> getAudioList() {
        return audioList;
    }

    public void setAudioList(List<FileListBean> audioList) {
        this.audioList = audioList;
    }

    public List<HomeworkClassListBean> getHomeworkClassList() {
        return homeworkClassList;
    }

    public void setHomeworkClassList(List<HomeworkClassListBean> homeworkClassList) {
        this.homeworkClassList = homeworkClassList;
    }

    public List<FileListBean> getImageList() {
        return imageList;
    }

    public void setImageList(List<FileListBean> imageList) {
        this.imageList = imageList;
    }

    public List<FileListBean> getVideoList() {
        return videoList;
    }

    public void setVideoList(List<FileListBean> videoList) {
        this.videoList = videoList;
    }

    public static class FileListBean implements Parcelable {

        /**
         * createTime : 1543546513000
         * creator : 340333
         * fileId : 4
         * format : MP4
         * id : 7
         * mediaType : 3
         * name : 20130405_113158.mp4
         * objId : 66
         * objType : 2
         * preimage : http://preview.eduhzy.net:1560/res01/2014/10/24/107/1928902322339_640x480 _5.jpg
         * status : 1
         * url : http://preview.eduhzy.net:1560/res01/2014/10/24/50/19737586871623_800x600.flv
         */

        private long createTime;
        private int creator;
        private String fileId;
        private String format;
        private int id;
        private int mediaType;
        private String name;
        private int objId;
        private int objType;
        private String preimage;
        private int status;
        private String url;

        public long getCreateTime() {
            return createTime;
        }

        public void setCreateTime(long createTime) {
            this.createTime = createTime;
        }

        public int getCreator() {
            return creator;
        }

        public void setCreator(int creator) {
            this.creator = creator;
        }

        public String getFileId() {
            return fileId;
        }

        public void setFileId(String fileId) {
            this.fileId = fileId;
        }

        public String getFormat() {
            return format;
        }

        public void setFormat(String format) {
            this.format = format;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getMediaType() {
            return mediaType;
        }

        public void setMediaType(int mediaType) {
            this.mediaType = mediaType;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getObjId() {
            return objId;
        }

        public void setObjId(int objId) {
            this.objId = objId;
        }

        public int getObjType() {
            return objType;
        }

        public void setObjType(int objType) {
            this.objType = objType;
        }

        public String getPreimage() {
            return preimage;
        }

        public void setPreimage(String preimage) {
            this.preimage = preimage;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeLong(this.createTime);
            dest.writeInt(this.creator);
            dest.writeString(this.fileId);
            dest.writeString(this.format);
            dest.writeInt(this.id);
            dest.writeInt(this.mediaType);
            dest.writeString(this.name);
            dest.writeInt(this.objId);
            dest.writeInt(this.objType);
            dest.writeString(this.preimage);
            dest.writeInt(this.status);
            dest.writeString(this.url);
        }

        public FileListBean() {
        }

        protected FileListBean(Parcel in) {
            this.createTime = in.readLong();
            this.creator = in.readInt();
            this.fileId = in.readString();
            this.format = in.readString();
            this.id = in.readInt();
            this.mediaType = in.readInt();
            this.name = in.readString();
            this.objId = in.readInt();
            this.objType = in.readInt();
            this.preimage = in.readString();
            this.status = in.readInt();
            this.url = in.readString();
        }

        public static final Creator<FileListBean> CREATOR = new Creator<FileListBean>() {
            @Override
            public FileListBean createFromParcel(Parcel source) {
                return new FileListBean(source);
            }

            @Override
            public FileListBean[] newArray(int size) {
                return new FileListBean[size];
            }
        };
    }

    public WorkDetailData() {
    }

    public static class HomeworkClassListBean implements Parcelable,Cloneable {
        @Override
        public Object clone() throws CloneNotSupportedException {
            return super.clone();
        }

        /**
         * checkedNum : 0
         * classId : 127
         * className : 理学班
         * id : 17
         * readNum : 0
         * submitNum : 0
         * totalNum : 1
         * workId : 12
         */
        private int checkedNum;
        private int classId;
        private String className;
        private int id;
        private int readNum;
        private int submitNum;
        private int totalNum;
        private int workId;
        private int online;
        private int type;
        private int studentId;

        public int getStudentId() {
            return studentId;
        }

        public void setStudentId(int studentId) {
            this.studentId = studentId;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public int getOnline() {
            return online;
        }

        public void setOnline(int online) {
            this.online = online;
        }

        public int getCheckedNum() {
            return checkedNum;
        }

        public void setCheckedNum(int checkedNum) {
            this.checkedNum = checkedNum;
        }

        public int getClassId() {
            return classId;
        }

        public void setClassId(int classId) {
            this.classId = classId;
        }

        public String getClassName() {
            return className;
        }

        public void setClassName(String className) {
            this.className = className;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getReadNum() {
            return readNum;
        }

        public void setReadNum(int readNum) {
            this.readNum = readNum;
        }

        public int getSubmitNum() {
            return submitNum;
        }

        public void setSubmitNum(int submitNum) {
            this.submitNum = submitNum;
        }

        public int getTotalNum() {
            return totalNum;
        }

        public void setTotalNum(int totalNum) {
            this.totalNum = totalNum;
        }

        public int getWorkId() {
            return workId;
        }

        public void setWorkId(int workId) {
            this.workId = workId;
        }

        public HomeworkClassListBean() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.checkedNum);
            dest.writeInt(this.classId);
            dest.writeString(this.className);
            dest.writeInt(this.id);
            dest.writeInt(this.readNum);
            dest.writeInt(this.submitNum);
            dest.writeInt(this.totalNum);
            dest.writeInt(this.workId);
            dest.writeInt(this.online);
            dest.writeInt(this.type);
            dest.writeInt(this.studentId);
        }

        protected HomeworkClassListBean(Parcel in) {
            this.checkedNum = in.readInt();
            this.classId = in.readInt();
            this.className = in.readString();
            this.id = in.readInt();
            this.readNum = in.readInt();
            this.submitNum = in.readInt();
            this.totalNum = in.readInt();
            this.workId = in.readInt();
            this.online = in.readInt();
            this.type = in.readInt();
            this.studentId = in.readInt();
        }

        public static final Creator<HomeworkClassListBean> CREATOR = new Creator<HomeworkClassListBean>() {
            @Override
            public HomeworkClassListBean createFromParcel(Parcel source) {
                return new HomeworkClassListBean(source);
            }

            @Override
            public HomeworkClassListBean[] newArray(int size) {
                return new HomeworkClassListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.content);
        dest.writeLong(this.createTime);
        dest.writeInt(this.creator);
        dest.writeString(this.creatorName);
        dest.writeLong(this.endTime);
        dest.writeInt(this.id);
        dest.writeInt(this.online);
        dest.writeLong(this.pushTime);
        dest.writeString(this.title);
        dest.writeTypedList(this.audioList);
        dest.writeTypedList(this.homeworkClassList);
        dest.writeTypedList(this.imageList);
        dest.writeTypedList(this.videoList);
    }

    protected WorkDetailData(Parcel in) {
        this.content = in.readString();
        this.createTime = in.readLong();
        this.creator = in.readInt();
        this.creatorName = in.readString();
        this.endTime = in.readLong();
        this.id = in.readInt();
        this.online = in.readInt();
        this.pushTime = in.readLong();
        this.title = in.readString();
        this.audioList = in.createTypedArrayList(FileListBean.CREATOR);
        this.homeworkClassList = in.createTypedArrayList(HomeworkClassListBean.CREATOR);
        this.imageList = in.createTypedArrayList(FileListBean.CREATOR);
        this.videoList = in.createTypedArrayList(FileListBean.CREATOR);
    }

    public static final Creator<WorkDetailData> CREATOR = new Creator<WorkDetailData>() {
        @Override
        public WorkDetailData createFromParcel(Parcel source) {
            return new WorkDetailData(source);
        }

        @Override
        public WorkDetailData[] newArray(int size) {
            return new WorkDetailData[size];
        }
    };
}
